package com.why.zing.payapi.feignclient;

import com.why.zing.common.domain.ZingResult;
import com.why.zing.payapi.model.delay.Job;
import com.why.zing.payapi.model.delay.JobDie;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 延迟队列请求Feign
 *
 * @author 睁眼看世界
 * @date 2020年2月25日
 */
@FeignClient(url = "http://localhost:8090", name = "DelayQueueFeign")
@RequestMapping(value = "/delayQueue")
public interface DelayQueueFeign {

    /**
     * 添加job
     *
     * @param job job
     * @return 结果
     */
    @PostMapping(value = "/addJob")
    ZingResult addJob(@RequestBody Job job);

    /**
     * 删除job
     *
     * @param jobDie 删除条件
     * @return 结果
     */
    @PostMapping(value = "/deleteJob")
    ZingResult deleteJob(@RequestBody JobDie jobDie);
}
